package com.bagu.bean3;

import org.springframework.context.support.ClassPathXmlApplicationContext;

/*
* 实例工厂的方法创建对象
* */
public class Client {

    public static void main(String[] args) {

        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");
        TestController testController = (TestController) context.getBean("TestController");
        TestService testService = (TestService) context.getBean("TestService");
        testController.testService2().method();
        testService.method();

    }

}